<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="header">
    <div class="main">
        <a class="logo" href="/" title="flyapi"></a>
        <div class="nav">
           <!-- class="nav-this"-->
            <a id="home"  href="../index.html" th:href="@{${rootPath} + '/index.html'}">
                <i class="fa fa-send fa-fw"></i>发现
            </a>
            <a id="subject" href="../forward/go?html=article/ebook" th:href="@{${rootPath} + '/forward/go?html=article/ebook'}" >
                <i class="fa fa-map-o fa-fw"></i>主题
            </a>
<!--            <a id="book" href="../forward/go?html=book/index" th:href="@{${rootPath} + '/forward/go?html=book/index'}">
                <i class="fa fa-book fa-fw"></i>易书
            </a>
            <a  data-dropdown="#dropdown-other">
                <i class="fa fa-list fa-fw"></i>其它
            </a>
            <div class="dropdown-menu dropdown-anchor-top-left dropdown-has-anchor" id="dropdown-other">
                <ul>
                    <li><a href="#">理财</a></li>
                    <li><a href="#">数字货币</a></li>
                    &lt;!&ndash;<li class="divider"></li>&ndash;&gt;
                    <li><a href="#">反馈</a></li>
                </ul>
            </div>-->
        </div>

        <div id="login-state">

        </div>
        <div class="nav-user" th:if="${session.user} == null">
            <a class="unlogin"><i class="fa fa-user-circle-o fa-2x"></i></a>
            <a class="layui-btn layui-btn-primary layui-btn-radius" th:href="@{${rootPath} + '/forward/go?html=login'}">登录/注册</a>
<!--            <span>
                <a href="#" th:href="@{${rootPath} + '/forward/go?html=login'}" class="layui-btn layui-btn-normal layui-btn-radius" >登录/注册</a>
            </span>-->
        </div>
        <div class="flyhero-user" th:unless="${session.user} == null">
            <a th:href="@{${rootPath} + '/article/123456'}" class="layui-btn layui-btn-normal layui-btn-radius" style="float: left; margin-top: 12px">写文章</a>
            <a th:href="@{${rootPath} + '/subject/123456'}" class="layui-btn layui-btn-normal layui-btn-radius" style="float: left; margin-top: 12px;margin-right: 10px">出主题</a>
            <div class="user-hover" style="width: 80px;height: 65px; float: right " data-dropdown="#dropdown-standard">
                <a class="avatar dropdown">
                    <img src="../static/images/avatar/flyhero.jpg" th:src="${session.user.avatar}">
                </a>
            </div>

            <div class="dropdown-menu dropdown-anchor-top-left dropdown-has-anchor" id="dropdown-standard">
                <ul>
                    <li><a th:href="@{${rootPath} + '/user/'+${session.user.userId}}"> <i class="layui-icon">&#xe68e;</i> 主页</a></li>
                    <li><a th:href="@{${rootPath} + '/user/index'}"><i class="layui-icon">&#xe620;</i>&nbsp;我的</a></li>
                    <li><a th:href="@{${rootPath} + '/user/set'}"><i class="layui-icon">&#xe620;</i>&nbsp;设置</a></li>
                    <li><a href="../user/logout" th:href="@{${rootPath} + '/user/logout'}"><i class="fa fa-sign-out fa-fw"></i>&nbsp;退出</a></li>
                    <!--<li class="divider"></li>-->
                </ul>
            </div>
        </div>
    </div>
</div>

</body>
</html>